﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ComesEnCasa.Negocio;

namespace ComesEnCasa.Web.Controllers
{
    public class RestauranteController : Controller
    {
        [HttpGet]
        public ActionResult ListadoPorEntidad(int? entidadId)
        {
            var restaurantes = RestauranteNegocio.Listado(entidadId.GetValueOrDefault());
            var result = restaurantes.Select(r => new
                                                      {
                                                          r.RestauranteId,
                                                          r.NombreCompleto
                                                      });
            return Json(result, JsonRequestBehavior.AllowGet);
        }

    }
}
